<?php
@session_start();
include "../include/config.php";
include "../include/db.php";

if($_REQUEST['tipo'] == "get_perfiles"){


	$query = "SELECT id_perfil, desc_perfil FROM admin_perfil";
	$result = mysql_query($query) or trigger_error(mysql_error());

	$jsonArr = array();

	while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {//solo las claves
		$row = array_map("utf8_encode", $row);   	
		$jsonArr[$row['id_perfil']] = $row['desc_perfil'];
		//$jsonArr[] = $row['desc_perfil'];
	}
	
	/* http://www.example.com/json.php?tipo= */

	// $jsonArr['E'] =  'Letter E'; 
	// $jsonArr['F'] =  'Letter F'; 
	// $jsonArr['G'] =  'Letter G'; 
	// $jsonArr['selected'] =  'F';
	echo json_encode($jsonArr);
 
}




 ?>